<?php

namespace org\copperforest\oak\resources;
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of ResourceTemplated
 *
 * @author agama
 */
class Response
{
    public $id=null;
    
    protected $className;
    protected $groundTemplate;
    protected $request = null;
    
    
    function __construct()
    {
        $this->className = get_class( $this );
    }

    function getId()
    {
        return $this->id;
    }
/*  
    function getGroundTemplate(){
        return $this->groundTemplate;
    }
*/
    function setGroundTemplate( $t )
    {
        $this->groundTemplate = $t;
        
        $resource_path = "";
        if( empty( $_SERVER[ 'CF_BUILD' ] ) ){
            $resource_path = CF_APP_PATH . 'resources' . DIRECTORY_SEPARATOR;
        }
        else {
            $resource_path = CF_BUILD_PATH . $_SERVER[ 'CF_BUILD' ] . DIRECTORY_SEPARATOR . 'resources' . DIRECTORY_SEPARATOR;
        }
        
        include $resource_path .  $this->groundTemplate . '.ground.php';
    }

    
    
    function doPost( $action )
    {
    }
    function doPut()
    {   
    }
    function doPatch()
    {
    }
    function doDelete()
    {
    }
}